package com.naiqing.poster.demo;

import com.quaint.poster.annotation.PosterBackground;
import com.quaint.poster.annotation.PosterFontCss;
import com.quaint.poster.annotation.PosterImageCss;
import com.quaint.poster.core.abst.AbstractDefaultPoster;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Tolerate;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * 〈商品分享海报元素及相关参数定义〉<br>
 *
 * @author naiqing
 * @Date 2022/1/21
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@EqualsAndHashCode(callSuper = true)
@Data
@Builder
public class CommodityPoster2Pojo extends AbstractDefaultPoster {

    /**
     * 背景图
     */
    @PosterBackground(width = 540, height = 868)
    private BufferedImage backgroundImage;

    /**
     * 商品图
     */
    @PosterImageCss(position = {0, 0}, width = 540, height = 614, radius = 50)
    private BufferedImage commodityImage;

    /**
     * 严选图标
     */
    @PosterImageCss(position = {16, 625}, width = 50, height = 28)
    private BufferedImage yanxuanImage;
    /**
     * 商品标题
     */
    @PosterFontCss(position = {16, 625}, size = 22, canNewLine = {1, 482, 2}, style = Font.BOLD)
    private String commodityTitle;

    /**
     * 特权价
     */
    @PosterFontCss(position = {16, 706}, size = 20, color = {247, 23, 61})
    private String vipPrice;
    /**
     * 原价
     */
    @PosterFontCss(position = {16, 742}, size = 15, color = {51, 51, 51}, delLine = true)
    private String oldPrice;

    /**
     * 头像
     */
    @PosterImageCss(position = {10, 780}, width = 55, height = 55, circle = true)
    private BufferedImage headImage;

    /**
     * 昵称
     */
    @PosterFontCss(position = {77, 788}, color = {85, 85, 85}, name = "腾祥爱情体细简", style = Font.BOLD)
    private String nickName;
    /**
     * 昵称下的描述
     */
    @PosterFontCss(position = {75, 813}, size = 15, color = {104, 104, 104}, name = "腾祥爱情体细简")
    private String nickDesc;

    /**
     * 二维码字
     */
    @PosterFontCss(position = {386, 833}, size = 20, color = {104, 104, 104}, center = true)
    private String qrCodeText;

    @Tolerate
    public CommodityPoster2Pojo() {
    }
}

